Optimal. Leaf size=146 \[ \frac {(e f+d g)^2}{16 d^4 e^3 (d-e x)}-\frac {(e f-d g)^2}{12 d^2 e^3 (d+e x)^3}-\frac {e^2 f^2-d^2 g^2}{8 d^3 e^3 (d+e x)^2}-\frac {(3 e f-d g) (e f+d g)}{16 d^4 e^3 (d+e x)}+\frac {f (e f+d g) \tanh ^{-1}\left (\frac {e x}{d}\right )}{4 d^5 e^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 146, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {862, 90, 214}
\begin {gather*} \frac {f (d g+e f) \tanh ^{-1}\left (\frac {e x}{d}\right )}{4 d^5 e^2}+\frac {(d g+e f)^2}{16 d^4 e^3 (d-e x)}-\frac {(3 e f-d g) (d g+e f)}{16 d^4 e^3 (d+e x)}-\frac {(e f-d g)^2}{12 d^2 e^3 (d+e x)^3}-\frac {e^2 f^2-d^2 g^2}{8 d^3 e^3 (d+e x)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 90
Rule 214
Rule 862
Rubi steps
\begin {align*} \int \frac {(f+g x)^2}{(d+e x)^2 \left (d^2-e^2 x^2\right )^2} \, dx &=\int \frac {(f+g x)^2}{(d-e x)^2 (d+e x)^4} \, dx\\ &=\int \left (\frac {(e f+d g)^2}{16 d^4 e^2 (d-e x)^2}+\frac {(-e f+d g)^2}{4 d^2 e^2 (d+e x)^4}+\frac {e^2 f^2-d^2 g^2}{4 d^3 e^2 (d+e x)^3}+\frac {(3 e f-d g) (e f+d g)}{16 d^4 e^2 (d+e x)^2}+\frac {f (e f+d g)}{4 d^4 e \left (d^2-e^2 x^2\right )}\right ) \, dx\\ &=\frac {(e f+d g)^2}{16 d^4 e^3 (d-e x)}-\frac {(e f-d g)^2}{12 d^2 e^3 (d+e x)^3}-\frac {e^2 f^2-d^2 g^2}{8 d^3 e^3 (d+e x)^2}-\frac {(3 e f-d g) (e f+d g)}{16 d^4 e^3 (d+e x)}+\frac {(f (e f+d g)) \int \frac {1}{d^2-e^2 x^2} \, dx}{4 d^4 e}\\ &=\frac {(e f+d g)^2}{16 d^4 e^3 (d-e x)}-\frac {(e f-d g)^2}{12 d^2 e^3 (d+e x)^3}-\frac {e^2 f^2-d^2 g^2}{8 d^3 e^3 (d+e x)^2}-\frac {(3 e f-d g) (e f+d g)}{16 d^4 e^3 (d+e x)}+\frac {f (e f+d g) \tanh ^{-1}\left (\frac {e x}{d}\right )}{4 d^5 e^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.07, size = 171, normalized size = 1.17 \begin {gather*} \frac {2 d \left (2 d^5 g^2+3 e^5 f^2 x^3+d^3 e^2 f (-4 f+g x)+3 d e^4 f x^2 (2 f+g x)+2 d^4 e g (f+2 g x)+d^2 e^3 f x (f+6 g x)\right )+3 e f (e f+d g) (-d+e x) (d+e x)^3 \log (d-e x)+3 e f (e f+d g) (d-e x) (d+e x)^3 \log (d+e x)}{24 d^5 e^3 (d-e x) (d+e x)^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 189, normalized size = 1.29
method | result | size |
norman | \(\frac {\frac {d f g -3 e \,f^{2}}{8 d \,e^{2}}-\frac {\left (-d^{2} g^{2}-d e f g -e^{2} f^{2}\right ) x^{3}}{3 d^{4}}+\frac {f \left (d g +e f \right ) x^{2}}{2 d^{3}}-\frac {e \left (-4 d^{2} g^{2}-d e f g -e^{2} f^{2}\right ) x^{4}}{24 d^{5}}}{\left (e x +d \right )^{3} \left (-e x +d \right )}-\frac {f \left (d g +e f \right ) \ln \left (-e x +d \right )}{8 d^{5} e^{2}}+\frac {f \left (d g +e f \right ) \ln \left (e x +d \right )}{8 d^{5} e^{2}}\) | \(162\) |
risch | \(\frac {\frac {e f \left (d g +e f \right ) x^{3}}{4 d^{4}}+\frac {f \left (d g +e f \right ) x^{2}}{2 d^{3}}+\frac {\left (4 d^{2} g^{2}+d e f g +e^{2} f^{2}\right ) x}{12 e^{2} d^{2}}+\frac {d^{2} g^{2}+d e f g -2 e^{2} f^{2}}{6 e^{3} d}}{\left (e x +d \right )^{2} \left (-e^{2} x^{2}+d^{2}\right )}-\frac {\ln \left (-e x +d \right ) f g}{8 e^{2} d^{4}}-\frac {\ln \left (-e x +d \right ) f^{2}}{8 e \,d^{5}}+\frac {\ln \left (e x +d \right ) f g}{8 e^{2} d^{4}}+\frac {\ln \left (e x +d \right ) f^{2}}{8 e \,d^{5}}\) | \(185\) |
default | \(-\frac {-d^{2} g^{2}+e^{2} f^{2}}{8 e^{3} d^{3} \left (e x +d \right )^{2}}-\frac {-d^{2} g^{2}+2 d e f g +3 e^{2} f^{2}}{16 e^{3} d^{4} \left (e x +d \right )}-\frac {d^{2} g^{2}-2 d e f g +e^{2} f^{2}}{12 e^{3} d^{2} \left (e x +d \right )^{3}}+\frac {f \left (d g +e f \right ) \ln \left (e x +d \right )}{8 d^{5} e^{2}}+\frac {d^{2} g^{2}+2 d e f g +e^{2} f^{2}}{16 e^{3} d^{4} \left (-e x +d \right )}-\frac {f \left (d g +e f \right ) \ln \left (-e x +d \right )}{8 d^{5} e^{2}}\) | \(189\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.30, size = 189, normalized size = 1.29 \begin {gather*} -\frac {2 \, d^{5} g^{2} + 2 \, d^{4} f g e - 4 \, d^{3} f^{2} e^{2} + 3 \, {\left (d f g e^{4} + f^{2} e^{5}\right )} x^{3} + 6 \, {\left (d^{2} f g e^{3} + d f^{2} e^{4}\right )} x^{2} + {\left (4 \, d^{4} g^{2} e + d^{3} f g e^{2} + d^{2} f^{2} e^{3}\right )} x}{12 \, {\left (d^{4} x^{4} e^{7} + 2 \, d^{5} x^{3} e^{6} - 2 \, d^{7} x e^{4} - d^{8} e^{3}\right )}} + \frac {{\left (d f g + f^{2} e\right )} e^{\left (-2\right )} \log \left (x e + d\right )}{8 \, d^{5}} - \frac {{\left (d f g + f^{2} e\right )} e^{\left (-2\right )} \log \left (x e - d\right )}{8 \, d^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 331 vs.
\(2 (140) = 280\).
time = 4.62, size = 331, normalized size = 2.27 \begin {gather*} -\frac {4 \, d^{6} g^{2} + 6 \, d f^{2} x^{3} e^{5} + 6 \, {\left (d^{2} f g x^{3} + 2 \, d^{2} f^{2} x^{2}\right )} e^{4} + 2 \, {\left (6 \, d^{3} f g x^{2} + d^{3} f^{2} x\right )} e^{3} + 2 \, {\left (d^{4} f g x - 4 \, d^{4} f^{2}\right )} e^{2} + 4 \, {\left (2 \, d^{5} g^{2} x + d^{5} f g\right )} e - 3 \, {\left (2 \, d^{2} f g x^{3} e^{4} - d^{5} f g e + f^{2} x^{4} e^{6} - 2 \, d^{3} f^{2} x e^{3} + {\left (d f g x^{4} + 2 \, d f^{2} x^{3}\right )} e^{5} - {\left (2 \, d^{4} f g x + d^{4} f^{2}\right )} e^{2}\right )} \log \left (x e + d\right ) + 3 \, {\left (2 \, d^{2} f g x^{3} e^{4} - d^{5} f g e + f^{2} x^{4} e^{6} - 2 \, d^{3} f^{2} x e^{3} + {\left (d f g x^{4} + 2 \, d f^{2} x^{3}\right )} e^{5} - {\left (2 \, d^{4} f g x + d^{4} f^{2}\right )} e^{2}\right )} \log \left (x e - d\right )}{24 \, {\left (d^{5} x^{4} e^{7} + 2 \, d^{6} x^{3} e^{6} - 2 \, d^{8} x e^{4} - d^{9} e^{3}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.68, size = 241, normalized size = 1.65 \begin {gather*} \frac {- 2 d^{5} g^{2} - 2 d^{4} e f g + 4 d^{3} e^{2} f^{2} + x^{3} \left (- 3 d e^{4} f g - 3 e^{5} f^{2}\right ) + x^{2} \left (- 6 d^{2} e^{3} f g - 6 d e^{4} f^{2}\right ) + x \left (- 4 d^{4} e g^{2} - d^{3} e^{2} f g - d^{2} e^{3} f^{2}\right )}{- 12 d^{8} e^{3} - 24 d^{7} e^{4} x + 24 d^{5} e^{6} x^{3} + 12 d^{4} e^{7} x^{4}} - \frac {f \left (d g + e f\right ) \log {\left (- \frac {d f \left (d g + e f\right )}{e \left (d f g + e f^{2}\right )} + x \right )}}{8 d^{5} e^{2}} + \frac {f \left (d g + e f\right ) \log {\left (\frac {d f \left (d g + e f\right )}{e \left (d f g + e f^{2}\right )} + x \right )}}{8 d^{5} e^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.64, size = 227, normalized size = 1.55 \begin {gather*} -\frac {{\left (d f g + f^{2} e\right )} e^{\left (-2\right )} \log \left ({\left | -\frac {2 \, d}{x e + d} + 1 \right |}\right )}{8 \, d^{5}} + \frac {{\left (d^{2} g^{2} + 2 \, d f g e + f^{2} e^{2}\right )} e^{\left (-3\right )}}{32 \, d^{5} {\left (\frac {2 \, d}{x e + d} - 1\right )}} + \frac {{\left (\frac {3 \, d^{4} g^{2} e^{3}}{x e + d} + \frac {6 \, d^{5} g^{2} e^{3}}{{\left (x e + d\right )}^{2}} - \frac {4 \, d^{6} g^{2} e^{3}}{{\left (x e + d\right )}^{3}} - \frac {6 \, d^{3} f g e^{4}}{x e + d} + \frac {8 \, d^{5} f g e^{4}}{{\left (x e + d\right )}^{3}} - \frac {9 \, d^{2} f^{2} e^{5}}{x e + d} - \frac {6 \, d^{3} f^{2} e^{5}}{{\left (x e + d\right )}^{2}} - \frac {4 \, d^{4} f^{2} e^{5}}{{\left (x e + d\right )}^{3}}\right )} e^{\left (-6\right )}}{48 \, d^{6}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.63, size = 148, normalized size = 1.01 \begin {gather*} \frac {\frac {d^2\,g^2+d\,e\,f\,g-2\,e^2\,f^2}{6\,d\,e^3}+\frac {f\,x^2\,\left (d\,g+e\,f\right )}{2\,d^3}+\frac {x\,\left (4\,d^2\,g^2+d\,e\,f\,g+e^2\,f^2\right )}{12\,d^2\,e^2}+\frac {e\,f\,x^3\,\left (d\,g+e\,f\right )}{4\,d^4}}{d^4+2\,d^3\,e\,x-2\,d\,e^3\,x^3-e^4\,x^4}+\frac {f\,\mathrm {atanh}\left (\frac {e\,x}{d}\right )\,\left (d\,g+e\,f\right )}{4\,d^5\,e^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________